<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>传智健康</title>
    <meta name="description" content="传智健康">
    <meta name="keywords" content="传智健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="plugins/elementui/index.css">
    <link rel="stylesheet" href="css/login.css">
    <script src="js/jquery.min.js"></script>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div id="app">
    <div class="login-container">
        <div class="loginBox">
            <form method="post" class="login-form" action="/login.do" label-position="left">
                <div class="title-container">
                    <div class="logoInfo clearfix">
                        <em class="logo"></em>
                    </div>
                </div>
                <div>
                        <span class="svg-container svg-container_login">
                          <span class="user"></span>
                        </span>
                    <input v-model="username"  type="text" name="username"  placeholder="请输入用户名" />
                </div>
                <div>
                        <span class="svg-container">
                          <span class="username"></span>
                        </span>
                    <input v-model="password"  type="password" name="password"   placeholder="请输入密码"/>
                </div>

                <div class="form-group" >
                    <label>
                        <input v-model="remember" id="remember-me"
                               name="remember-me"
                               type="checkbox"/>记住账户密码
                    </label>
                </div>

                <input @click="submitclick"  type="submit" style="width:100%;margin-bottom:30px;" value="登录"/>
            </form>
        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="js/vue.js"></script>
<script src="plugins/elementui/index.js"></script>
<script>

    var vue = new Vue({

        el:"#app",
        data:{
            username:'',
            password:'',
            remember:true
        },

        mounted() {

            this.username = localStorage.getItem("username");
            this.password = localStorage.getItem("password");
            localStorage.clear();

        },

        methods:{
            submitclick(){

                if (this.remember == true){
                    localStorage.setItem("username", this.username);
                    localStorage.setItem("password", this.password);

                }

            },

        }

    })

</script>
</html>
